package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QChatMapper;
import com.ruoyi.system.domain.QChat;
import com.ruoyi.system.service.IQChatService;
import com.ruoyi.common.core.text.Convert;

/**
 * 聊天记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-26
 */
@Service
public class QChatServiceImpl implements IQChatService 
{
    @Autowired
    private QChatMapper qChatMapper;

    /**
     * 查询聊天记录
     * 
     * @param chatId 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public QChat selectQChatByChatId(Long chatId)
    {
        return qChatMapper.selectQChatByChatId(chatId);
    }

    /**
     * 查询聊天记录列表
     * 
     * @param qChat 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<QChat> selectQChatList(QChat qChat)
    {
        return qChatMapper.selectQChatList(qChat);
    }

    /**
     * 新增聊天记录
     * 
     * @param qChat 聊天记录
     * @return 结果
     */
    @Override
    public int insertQChat(QChat qChat)
    {
        return qChatMapper.insertQChat(qChat);
    }

    /**
     * 修改聊天记录
     * 
     * @param qChat 聊天记录
     * @return 结果
     */
    @Override
    public int updateQChat(QChat qChat)
    {
        return qChatMapper.updateQChat(qChat);
    }

    /**
     * 批量删除聊天记录
     * 
     * @param chatIds 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteQChatByChatIds(String chatIds)
    {
        return qChatMapper.deleteQChatByChatIds(Convert.toStrArray(chatIds));
    }

    /**
     * 删除聊天记录信息
     * 
     * @param chatId 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteQChatByChatId(Long chatId)
    {
        return qChatMapper.deleteQChatByChatId(chatId);
    }
}
